#include <stdio.h>

int main()
{
    double e = 1.0;
    double fac = 1.0;
    int n = 1;
    while( fac < 1e6 )
    {
        fac = fac * n;
        e = e + 1 / fac;
        n = n + 1;
    }
    printf("e: %.6lf\n", e);
    return 0;
}